package com.wlsk.license.common.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 包车类型  plate 对应charter_type
 */
public enum CharterTypeEnum implements BaseEnum<CharterTypeEnum, String> {

    INTER_PROVINCIAL_CHARTER("00030008", "省际包车客运"),

    INTER_COUNTY_CHARTER("00030006", "县际包车客运"),

    INTRA_COUNTY_CHARTER("00030005", "县内包车客运"),

    MAIN_CITY_CHARTER("00030009", "主城区包车"),

    COMMUTER_BUS("00030010", "通勤车");

    private final String code;

    private final String description;

    private static Map<String, CharterTypeEnum> valueMap = new HashMap<>();

    CharterTypeEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }

    static {
        for (CharterTypeEnum e : CharterTypeEnum.values()) {
            valueMap.put(e.code, e);
        }
    }

    public static CharterTypeEnum get(String value) {
        return valueMap.get(value);
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getDescription() {
        return description;
    }

    @Override
    public CharterTypeEnum getByCode(String code) {
        return valueMap.get(code);
    }
}
